package com.geologyoa.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.geologyoa.domain.xmqkQueryObj;
import com.geologyoa.service.SystemManager;
import com.geologyoa.service.SystemManagerImpl;

public class statXmqk01 extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public statXmqk01() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request, response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/xml;charset=utf-8");
		response.setHeader("Cache-Control", "no-cache");
		response.setHeader("Expires", "0");
		response.setHeader("Pragma", "No-cache");
		PrintWriter out = response.getWriter();
		SystemManager sys=new SystemManagerImpl();
		String XMQK01003 = request.getParameter("XMQK01003");//项目名称
		String XMQK01005s = request.getParameter("XMQK01005s");///项目年度起
		String XMQK01005e = request.getParameter("XMQK01005e");///项目年度止
		String XMQK01006 = request.getParameter("XMQK01006");//项目类型或者项目子类型
		String XMQK01009 = request.getParameter("XMQK01009");//承担单位
		String XMQK01136 = request.getParameter("XMQK01136");//项目所在市
		String XMQK01137 = request.getParameter("XMQK01137");//项目所在县
		/*XMQK01003 = "";
		XMQK01005s = "";
		XMQK01005e = "";
		XMQK01006 = "";
		XMQK01009 = "";
		XMQK01036 = "";
		XMQK01037 = "";*/
		xmqkQueryObj xmqkQueryObj = new xmqkQueryObj(XMQK01003,  XMQK01006, XMQK01009, XMQK01136, XMQK01137,XMQK01005s,XMQK01005e);
		String res = sys.statXmqk01(xmqkQueryObj);
		//System.out.println(res);
		out.write(res);
		out.close();
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occurs
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
